#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "arquivo/arquivo.h"
#include "renderizador.h"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void openFile(Arquivo::FileType type, void **config);

protected:
    void changeEvent(QEvent *e);
    void mousePressEvent(QMouseEvent *e);

private slots:
    void refresh();
    void openObject();
    void openIlumination();
    void openCamera();
    void gouraudShading();
    void phongShading();
    void shadowMapping();
    void wPressed();
    void aPressed();
    void sPressed();
    void dPressed();
    void plusPressed();
    void minusPressed();
    void escPressed();
    void restoreMouse();

private:
    Ui::MainWindow *ui;
    Objeto *objeto;
    Iluminacao *iluminacao;
    Camera *camera;
    Renderizador *renderer;
    Arquivo file;
    bool w;
    bool a;
    bool s;
    bool d;
    bool plus;
    bool minus;
    bool shading;
    bool shadow;
    bool mouseFPS;
    int k;
    void setMouseFPS();
    void createActions();
    void checkRenderer();
    void initRenderer();
    void paint();
};

#endif // MAINWINDOW_H
